<?php
/**
 * Miffos framework
 * ----------------------------------------------
 *
 * Copyright (c) 2008, 2009 Martin Sadový (http://sodae.cz)
 *
 * This source file is subject to the "Miffos license" that is bundled
 * with this package in the file license.txt.
 *
 * @copyright  Copyright (c) 2008, 2009 Martin Sadový
 * @license    license.txt
 * @link       http://miffos.sodae.cz
 * @package    miffos
 * @version    $Id$
 */


  class FormTextarea extends FormControl
  {
    protected $tag  = 'textarea';

    public function setValue($value){
      $this->element->cleanContent();
      $this->element->setText($value);
      parent::setValue($value);
    }
  }

  class FormTextInput extends FormInputExtends
  {
    protected $type = 'text';
  }

  class FormPasswordInput extends FormInputExtends
  {
    protected $type = 'password';
  }


  class FormInputExtends extends FormControl{
    protected $tag  = 'input';

    public function __construct($form, $name,$label)
    {
        parent::__construct($form, $name, $label);
        $this->element->type = $this->type;
    }

    public function setValue($value){
      if(!($this instanceof FormCheckboxInput)){
          $this->element->value($value);
      }
      parent::setValue($value);
    }
  }
?>